package xiaohongshu

import (
	"github.com/gin-gonic/gin"
)

type XhsAuthRouter struct{}

// InitXhsAuthRouter 初始化 xhsAuth表 路由信息
func (s *XhsAuthRouter) InitXhsAuthRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) {

	//外部访问接口 - 未登录
	xhsAuthRouterWithoutAuth := PublicRouter.Group("xhsAuth")
	{
		xhsAuthRouterWithoutAuth.GET("getTicketPublic", xhsAuthApi.GetTicketPublic).POST("getTicketPublic", xhsAuthApi.GetTicketPublic) // getTicketPublic 表开放接口
	}

	//内部访问 - 登录
	//xhsAuthRouter := Router.Group("xhsAuth").Use(middleware.OperationRecord())
	xhsAuthRouterWithoutRecord := Router.Group("xhsAuth")
	{
		//xhsAuthRouter.POST("createXhsAccessToken", xhsAuthApi.GetAccessToken)       // 新建xhsAuth表
		//xhsAuthRouter.DELETE("deleteXhsAccessToken", xhsAuthApi.GetPreAuthCode)     // 删除xhsAuth表
		//xhsAuthRouter.DELETE("deleteXhsAccessTokenByIds", xhsAuthApi.Authorization) // 批量删除xhsAuth表
		//xhsAuthRouter.PUT("updateXhsAccessToken", xhsAuthApi.Callback)              // 更新xhsAuth表
	}
	{
		xhsAuthRouterWithoutRecord.POST("getAccessToken", xhsAuthApi.GetAccessToken)   // 获取 accessToken
		xhsAuthRouterWithoutRecord.DELETE("getPreAuthCode", xhsAuthApi.GetPreAuthCode) // 获取 GetPreAuthCode
		xhsAuthRouterWithoutRecord.DELETE("authorization", xhsAuthApi.Authorization)   // 授权二维码展示 authorization
		xhsAuthRouterWithoutRecord.PUT("callback", xhsAuthApi.Callback)                // 授权二维码展示 authorization 回调接口
	}

}
